import React from 'react'
import { HashRouter as Router, Route, Switch, Redirect } from 'react-router-dom'
import Home from '../view/Home'
import Task from '../view/Task.js'
import ProductManage from '../view/ProductManage'
import UserManage from '../view/UserManage'
import ProjectManage from '../view/ProjectManage'
import StatisticsAnalysis from '../view/StatisticsAnalysis'
import CreateTask from '../view/CreateTask'
import EditTask from '../view/EditTask'

export default () => (
  <Router>
    <Switch>
      <Route path="/home" component={Home} />
      <Route path="/task" component={Task} />
      <Route path="/productManage" component={ProductManage} />
      <Route path="/projectManage" component={ProjectManage} />
      <Route path="/userManage" component={UserManage} />
      <Route path="/statisticsAnalysis" component={StatisticsAnalysis} />
      <Route path="/createTask" component={CreateTask} />
      <Route path="/editTask/:id" component={EditTask} />
      <Route exact path="/" render={() => <Redirect to="/home" />} />
    </Switch>
  </Router>
)
